﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="wfIframGoodsSel.aspx.cs" Inherits="msBsc.WebUi.wfIframGoodsSel" %>

<!DOCTYPE HTML>
<html>
<head id="Head1" runat="server"> 
    <title>商品选择</title>
    <link rel="shortcut icon" href="/themes/Style1/Image/favicon.ico"
        type="image/x-icon" /> 
    <link rel="stylesheet" href="/??themes/Style1/StyleQt.css" />
    <script src="/??jqPlugin/js/jquery-1.8.3.min.js,js/jBase.js,js/jBPage.js,themes/Style1/jsQt.js,jqPlugin/js/laytpl.js"
        type="text/javascript"></script>
    <!--head fix rgn-->
    <style type="text/css">
        .img-item
        {
            float: left;
            background-color: #eee;
            margin: 5px;
            padding: 5px;
            border: 2px solid #ddd;
            width:100px;
        }
        .img-item-select
        {
            border: 2px solid #C00;
        }
        .text-overflow
        {
            width: 100%;
            display: block; /*内联对象需加*/
            width: 31em;
            word-break: keep-all; /* 不换行 */
            white-space: nowrap; /* 不换行 */
            text-overflow: ellipsis; /* 当对象内文本溢出时显示省略标记(...) ；需与overflow:hidden;一起使用。*/
            overflow: hidden; /* 内容超出宽度时隐藏超出部分的内容 */
        }
        .text-overflow2
        { 
            width: 100%;
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
        }
		.winWrap{}
		.winTit{padding: 5px 10px;}
		.wGoodsWrap{width: auto; height: auto; float: left; border: 1px dashed #c4d5e0; padding: 5px; background-color: white;
			margin-left: 10px; margin-top: 10px; cursor: move;}
		.wStyle2{width: 492px; height: 293px;}
		.wStyle2 img,.wStyle2 .wGoodsImg{width: auto; height: 253px;}
		.wStyle3{width: 320px; height: 263px;} 
		.wStyle3 img,.wStyle3 .wGoodsImg{width: auto; height: 223px;}
		.wStyle4{width: 233px; height: 193px;}
		.wStyle4 img,.wStyle4 .wGoodsImg{width: auto; height: 153px;}
		.wStyle5{width: 183px; height: 193px;}
		.wStyle5 .wGoodsImg{width: 183px; height: 153px;}
		.wGoodsImg{ overflow:hidden;}
		.wGoodsImg img{width: auto; height: auto;}
		
		.wStyle6{width: 253px; height: 293px;}
		.wStyle6 img,.wStyle6 .wGoodsImg{width: 253px; height: 253px;}
		.wStyle8{width: 184px; height: 224px;}
		.wStyle8 img,.wStyle8 .wGoodsImg{width: 184px; height: 184px;}
		.wStyle10{width: 142px; height: 182px;}
		.wStyle10 img,.wStyle10 .wGoodsImg{width: 142px; height: 142px;}
		.wStyle9{width: 253px; height: 293px;}
		.wStyle9 img,.wStyle9 .wGoodsImg{width: 253px; height: 253px;}
		.wStyle12{width: 184px; height: 224px;}
		.wStyle12 img,.wStyle12 .wGoodsImg{width: 184px; height: 184px;}
		.wStyle15{width: 142px; height: 182px;}
		.wStyle15 img,.wStyle15 .wGoodsImg{width: 142px; height: 142px;}
		.winBox{height: auto; overflow: hidden; position: relative;}
		.wBoxStype6{height: 644px;}
		.wBoxStype8{height: 504px;}
		.wBoxStype10{height: 420px;}
		.wBoxStype9{height: 960px;}
		.wBoxStype12{height: 754px;}
		.wBoxStype15{height: 625px;}
		.ngImg{width: 55px; height: 55px; display: block; float: left; margin-left: 5px; margin-top: 5px;
			background-color: #fff; cursor: pointer;}
		#ngConfirm{margin-right:10px; float:right; margin-top: 20px;}
		.wGoodsTxt{line-height: 16px; height: 32px; overflow: hidden;}
		.wGoodsClearWrap{height:3px;}
		.wGoodsClearBtn{width: 16px; height: 16px; display: block; position: absolute; margin-top: -16px; cursor: pointer;
			margin-left: 0px; background: url("../images/portal/minPng-80-450.png") -41px 0px; z-index: 100;}
		/*.wGoodsClearBtn:hover{background-position: -22px 0px;}*/
    </style>
    <script type="text/javascript">
        $(window).load(function () {
            $.ploadFile("layer", function (script, textStatus) {
                //                layer.load('加载中'); 
            });
            $("#page_col_list .img-item").live("click", function () {
                var $self = $(this);
                var $ckbtm = $self.find(" input");
                if ($self.hasClass("img-item-select")) {
                    $self.removeClass("img-item-select");
                    $ckbtm.attr("checked", false);
                } else {
                    $self.addClass("img-item-select");
                    $ckbtm.attr("checked", true);
                }
//                if ($ckbtm.attr("checked") || $ckbtm.attr("checked") == "checked") {
//                }
            });
            $("#page_col_list input").live("click", function () {
                var $self = $(this).parent().parent();
                if ($self.hasClass("img-item-select")) {
                    $self.removeClass("img-item-select");
                    $(this).attr("checked", false);
                } else {
                    $self.addClass("img-item-select");
                    $(this).attr("checked", true);
                }
            });
        });
        function btnDo(sEbtn) {
            GtGrid1Action = sEbtn;
            var opart = GetGtParam();
            if (sEbtn == "btnSave") {
            }
            else {
                ajaxComm(opart); //调用页面回调，并传入参数
            }
            GtGrid1Action = "";
        };
        function GetGtParam(jqGridID) {
            var _jsParam = new jsonRow();
            _jsParam.AddCell("ACTION", GtGrid1Action);
            //这里可增加传入后台的参数
            return _jsParam;
        };

        function loadGoodslist(_pNum) {
            var _jsParam = new jsonRow();
            _jsParam.AddCell("ACTION", "loadGoodslist");

            _jsParam.AddCell("GOODS_NME", $("#txtGOODS_NME").val()); 
            _jsParam.AddCell("NEW_PAGE_NUM", _pNum || $("#Ratecurrpage").val());
            _jsParam.AddCell("PAGE_ROW_COUNT", "20");
            _jsParam.AddCell("PAGE_ROW_SORT", "");

            ajaxComm(_jsParam);
        };
        function doBoundGoodsList(_data, _shopurl) { 
            var tpl = HtmlUtil.htmlDecode($("#list_temp").val());
            laytpl(tpl).render(_data, function (render) {
                $("#page_col_list").html(render);
            });
            $("#Ratecurrpage").val(_data.page);
            createPaging('paging_contet', _data.page, _data.total, function (_topagenum) { loadGoodslist(_topagenum); });
        };
        function doSelected() {
            $("#page_col_list .img-item-select").each(function (i, k) {
                if (parent && parent.GoodsSelEnd) {
                    parent.GoodsSelEnd($(this).attr("goods-id"), $(this).attr("goods-nme"), $(this).attr("goods-img"));
                }
            });
            if (parent && parent.layer) {
                var index = parent.layer.getFrameIndex(window.name);
                setTimeout(function () { parent.layer.close(index); }, 200);
            }
        };
    </script>
</head>
<body> 
                            
                             
          <div id="divCondition" style="margin: 3px; border-style: solid; border-width: 0px;
                border-color: #C8D2E0; background-color:#fff; padding:3px; font-size:14px;">
                <table border="0" cellpadding="0" cellspacing="0" style="float:right; width:auto;"> 
                    <tr> 
                    <td align="left" style="float:left;">
                        <input class="btn btn-mini btn-danger" id="Button1"  type="button" onclick="javascript:doSelected();return false;" value="确认选择"/>
                        
                    </td>
                        <td width="100px" align="right" style=" padding-right:5px;">
                            商品名称 </td>
                        <td align="right" width="110px">
                            <input class="" id="txtGOODS_NME" type="text" value="" style="width:150px;height:22px;" />
                        </td> 
                        <td align="center" style=" padding-left:20px;">
                            
                        <input class="btn btn-mini btn-danger" id="btnFinder"  type="button" onclick="javascript:loadGoodslist();return false;" value="查询并刷新商品列表"/>
                        
                                </td>
                    </tr>
                </table>
                <div style="clear:both;"></div>
            </div>
                            <div style=" background-color:#fff; padding:3px;">

<div class="page-col" style="margin: 3px; padding: 3px; background-color: #eee;">
    <div id="page_col_list">
    
    </div>
</div>
                            </div>


                                   <div style="height: 50px; clear: both;">
                                </div>
                            
                            
    <div class="" style="background-color: #eee; height: 42px; position:fixed; bottom:0px;width:100%; padding:1px; vertical-align:top;">  
    <div id="paging_contet"></div>
    </div>
<input type="hidden" id="Ratecurrpage" value="1" />
        <!-- template --> 
        <textarea id="list_temp" style="display: none;">   
        {{# for(var i = 0, len = d.rows.length; i < len; i++){ }}
        <div class="img-item  f-file" style="" goods-id="{{ d.rows[i].GOODS_ID }}" goods-nme="{{ d.rows[i].GOODS_NME }}" goods-img="{{ d.rows[i].IMG_URL }}">
            <div style=" background-color:White;">
            <div style=" height:80px; text-align:center;">
                <img class="" src="{{ d.rows[i].IMG_URL }}" style=" max-width:100px;height:80px;"/>
            </div></div>
            <div  style=" display:inline-block;"  class="text-overflow2 text-overflow"> 
            <input id="ckb{{ d.rows[i].GOODS_ID }}" type="checkbox" name="ckb{{ d.rows[i].GOODS_ID }}" value="{{ d.rows[i].GOODS_ID }}"/><label for="ckb{{ d.rows[i].GOODS_ID }}"  title="{{ d.rows[i].GOODS_NME }} "> {{ d.rows[i].GOODS_NME }} </label>
              
            </div>
        </div>
        {{# } }} 
        </textarea>
    <!-- foot script -->
</body>
</html>
